Skip to content

Refactor AppConsole to a shared data model#202

Merged
jlewi merged 3 commits into
mainfrom
dev/jlewi/webmcp
May 12, 2026
Merged

Refactor AppConsole to a shared data model#202
jlewi merged 3 commits into
mainfrom
dev/jlewi/webmcp

Conversation

@jlewi
Copy link
Copy Markdown
Collaborator

@jlewi jlewi commented May 10, 2026

Summary

  • extract AppConsole state, hydration, and persistence into a shared AppConsoleData model with a useSyncExternalStore hook
  • refactor the AppConsole UI to render that shared snapshot and route draft edits/execution through the model
  • wire WebMCP ExecuteCode into the shared transcript with streaming stdout/stderr hooks and add the AppConsole model-view design doc

Testing

  • pnpm -C app exec vitest run src/lib/appConsole/AppConsoleData.test.ts src/components/AppConsole/AppConsole.test.tsx src/components/WebMcp/WebMcpToolRegistrationHost.test.tsx src/lib/runtime/codeModeExecutor.test.ts
  • runme run build test

Signed-off-by: Jeremy lewi <jeremy@lewi.us>
@jlewi jlewi requested a review from sourishkrout as a code owner May 10, 2026 20:35
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5cf8d3ea45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +99 to +101
appConsoleData.completeExecution(execution.cellId, {
exitCode: 0,
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Use actual ExecuteCode outcome when finalizing console cell

This always finalizes WebMCP executions as success (exitCode: 0) whenever codeModeExecutor.execute resolves, but execute can resolve even when user code fails (the kernels report failures via stderr/exit code rather than throwing in normal runtime-error cases). In those cases the App Console cell is marked success instead of error, which makes the transcript status inaccurate and can mislead users about whether tool-run code actually succeeded.

Useful? React with 👍 / 👎.

jlewi added 2 commits May 10, 2026 14:27
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
Signed-off-by: Jeremy lewi <jeremy@lewi.us>
@jlewi jlewi merged commit 828fcdc into main May 12, 2026
3 checks passed
@jlewi jlewi deleted the dev/jlewi/webmcp branch May 12, 2026 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant